1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$iostream$>$
}} \\
4 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$climits$>$
}} \\
5 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$algorithm$>$
}} \\
7 \mbox{}\textbf{\textcolor{Blue
}{using
}}\
\textbf{\textcolor{Blue
}{namespace
}}\ std
\textcolor{BrickRed
}{;
} \\
9 \mbox{}\textcolor{ForestGreen
}{unsigned
}\
\textcolor{ForestGreen
}{long
}\
\textcolor{ForestGreen
}{long
}\ g
\textcolor{BrickRed
}{[}\textcolor{Purple
}{101}\textcolor{BrickRed
}{][}\textcolor{Purple
}{101}\textcolor{BrickRed
}{];
} \\
11 \mbox{}\textcolor{ForestGreen
}{int
}\
\textbf{\textcolor{Black
}{main
}}\textcolor{BrickRed
}{()
}\textcolor{Red
}{\
{} \\
12 \mbox{}\ \
\textcolor{ForestGreen
}{int
}\ casos
\textcolor{BrickRed
}{;
} \\
13 \mbox{}\ \ cin\
\textcolor{BrickRed
}{$>$$>$
}\ casos
\textcolor{BrickRed
}{;
} \\
14 \mbox{}\ \
\textcolor{ForestGreen
}{bool
}\ first\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Blue
}{true
}}\textcolor{BrickRed
}{;
} \\
15 \mbox{}\ \
\textbf{\textcolor{Blue
}{while
}}\
\textcolor{BrickRed
}{(
}casos
\textcolor{BrickRed
}{-\/-)
}\textcolor{Red
}{\
{} \\
16 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{if
}}\
\textcolor{BrickRed
}{(!
}first
\textcolor{BrickRed
}{)
}\ cout\
\textcolor{BrickRed
}{$<$$<$
}\ endl
\textcolor{BrickRed
}{;
} \\
17 \mbox{}\ \ \ \ first\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Blue
}{false
}}\textcolor{BrickRed
}{;
} \\
19 \mbox{}\ \ \ \
\textcolor{ForestGreen
}{int
}\ n
\textcolor{BrickRed
}{,
}\ e
\textcolor{BrickRed
}{,
}\ t
\textcolor{BrickRed
}{;
} \\
20 \mbox{}\ \ \ \ cin\
\textcolor{BrickRed
}{$>$$>$
}\ n\
\textcolor{BrickRed
}{$>$$>$
}\ e\
\textcolor{BrickRed
}{$>$$>$
}\ t
\textcolor{BrickRed
}{;
} \\
21 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}i
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
22 \mbox{}\ \ \ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ j
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ j
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}j
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
23 \mbox{}\ \ \ \ \ \ \ \ g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}j
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\ INT$
\_$MAX
\textcolor{BrickRed
}{;
} \\
24 \mbox{}\ \ \ \ \ \
\textcolor{Red
}{\
}} \\
25 \mbox{}\ \ \ \ \ \ g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}i
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\
\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
} \\
26 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
28 \mbox{}\ \ \ \
\textcolor{ForestGreen
}{int
}\ m
\textcolor{BrickRed
}{;
} \\
29 \mbox{}\ \ \ \ cin\
\textcolor{BrickRed
}{$>$$>$
}\ m
\textcolor{BrickRed
}{;
} \\
30 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{while
}}\
\textcolor{BrickRed
}{(
}m
\textcolor{BrickRed
}{-\/-)
}\textcolor{Red
}{\
{} \\
31 \mbox{}\ \ \ \ \ \
\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{,
}\ j
\textcolor{BrickRed
}{,
}\ k
\textcolor{BrickRed
}{;
} \\
32 \mbox{}\ \ \ \ \ \ cin\
\textcolor{BrickRed
}{$>$$>$
}\ i\
\textcolor{BrickRed
}{$>$$>$
}\ j\
\textcolor{BrickRed
}{$>$$>$
}\ k
\textcolor{BrickRed
}{;
} \\
33 \mbox{}\ \ \ \ \ \ g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{-
}\textcolor{Purple
}{1}\textcolor{BrickRed
}{][}j
\textcolor{BrickRed
}{-
}\textcolor{Purple
}{1}\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\ k
\textcolor{BrickRed
}{;
} \\
34 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
36 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ k
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ k
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}k
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
37 \mbox{}\ \ \ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}i
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
38 \mbox{}\ \ \ \ \ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ j
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ j
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}j
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
39 \mbox{}\ \ \ \ \ \ \ \ \ \ g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}j
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{=
}\
\textbf{\textcolor{Black
}{min
}}\textcolor{BrickRed
}{(
}g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}j
\textcolor{BrickRed
}{],
}\ g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}k
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{+
}\ g
\textcolor{BrickRed
}{[}k
\textcolor{BrickRed
}{][}j
\textcolor{BrickRed
}{]);
} \\
40 \mbox{}\ \ \ \ \ \ \ \
\textcolor{Red
}{\
}} \\
41 \mbox{}\ \ \ \ \ \
\textcolor{Red
}{\
}} \\
42 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
44 \mbox{}\ \ \ \
\textcolor{ForestGreen
}{int
}\ r
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
} \\
45 \mbox{}\ \ \ \ e\
\textcolor{BrickRed
}{-=
}\
\textcolor{Purple
}{1}\textcolor{BrickRed
}{;
} \\
46 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{$<$
}n
\textcolor{BrickRed
}{;
}\
\textcolor{BrickRed
}{++
}i
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
47 \mbox{}\ \ \ \ \ \ r\
\textcolor{BrickRed
}{+=
}\
\textcolor{BrickRed
}{((
}g
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{][}e
\textcolor{BrickRed
}{]}\
\textcolor{BrickRed
}{$<$=
}\ t
\textcolor{BrickRed
}{)
}\
\textcolor{BrickRed
}{?
}\
\textcolor{Purple
}{1}\
\textcolor{BrickRed
}{:
}\
\textcolor{Purple
}{0}\textcolor{BrickRed
}{);
}\ \ \ \ \ \ \\
48 \mbox{}\ \ \ \ \ \
\textit{\textcolor{Brown
}{/*\ \ \ \ \ \ if\ (g
[i
][e
]\ $<$=\ t)\
{}} \\
49 \mbox{}\textit{\textcolor{Brown
}{\ \ \ \ \ \ \ \ cout\ $<$$<$\ "
{}Adding\ "
{}\ $<$$<$\ i+
1\ $<$$<$\ "
{}\ -\ distancia:\ "
{}\ $<$$<$\ g
[i
][e
]\ $<$$<$\ endl;
}} \\
50 \mbox{}\textit{\textcolor{Brown
}{\ \ \ \ \ \ \ \ \
}*/
}} \\
51 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
53 \mbox{}\ \ \ \ cout\
\textcolor{BrickRed
}{$<$$<$
}\ r\
\textcolor{BrickRed
}{$<$$<$
}\ endl
\textcolor{BrickRed
}{;
} \\
54 \mbox{}\ \
\textcolor{Red
}{\
}} \\
55 \mbox{}\ \
\textbf{\textcolor{Blue
}{return
}}\
\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
} \\
56 \mbox{}\textcolor{Red
}{\
}} \\